/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package org.abc;

/**
 * <p>Project: jse2303 - Format1
 * <p>Powered by webrx On @date 2023-07-10
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Format1 {
    public static void main(String[] args) {

        System.out.printf("%(05d%n", -6);
        System.out.printf("(%05d)%n", 6);

        //String.format("%",); 格式化字符串并返回字符串
        //System.out.printf("");格式化字符串直接输出
        System.out.printf("%d %f %tF %s %n", 10, .5, System.currentTimeMillis(), "李四");
        System.out.printf("%tY年%<tm月%<td日 %<tp %<tA %<ta %<tb %<tB", System.currentTimeMillis());
        System.out.println();
        System.out.printf("%-35s%n", "李四");
        System.out.printf("%-35s%n", "张三丰");
        System.out.printf("%-35s%n", "张丰");
        System.out.printf("%05d%n", 1);
        System.out.printf("%05d%n", 2);
        System.out.printf("%d %02d %03d %04d%n", 1, 2, 3, 4);
        String ss = String.format("%.2f%n", 1.555555);
        System.out.println(ss);

        System.out.printf("%.2f%n%n", 1.555555);
    }
}
